package net.codejava.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;


public class TestLog4jServlet extends HttpServlet {
	
	static final Logger log = Logger.getLogger(TestLog4jServlet.class); 
	
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
		log.info("This is a logging statement from log4j + modified");
		log.info("Line added");
		
		try{
			Integer.parseInt("x");
		}catch(Exception e){
			log.debug(e.getMessage());
		}
		
		String html = "<html><h2>Log4j has been initialized successfully!</h2></html>";
		response.getWriter().println(html);
	}
}